<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script src="/js/jquery-2.1.1.min.js"></script>


    <link rel="stylesheet" href="/js/easyui1.5/themes/icon.css">
    <link rel="stylesheet" href="/js/easyui1.5/themes/default/easyui.css">
    <script src="/js/easyui1.5/jquery.easyui.min.js"></script>


</head>
<script type="text/javascript"  th:inline="none">
    $(function(){
        loadTree();
    });

    //同步树
    function loadTree(){
        $('#tree').tree({
            url:'/tree/getTree' ,
            onClick:function(node){
                var id = $("#tabs").tabs('exists', node.text);

                if(node.children!=null){return;}
                if(node.url==null){return;}
                if(id){
                    $("#tabs").tabs('select', node.text);
                }else{
                    if(node.children == null){
                        $('#tabs').tabs('add',{
                            title:node.text,
                            content:goToPage(node.url),
                            closable:true,
                        });
                    }else{
                        return "1";
                    }
                }
            }
        });
    }
    function goToPage(url){
        return '<iframe scrolling="auto" frameborder="0"  src="/view/toView?viewName=' + url + '" style="width:100%;height:100%;"></iframe>';
    }


</script>
<body>


<div id="cc" class="easyui-layout" fit=true >
    <div data-options="region:'north',title:'后台管理',split:true" style="height:150px;">

       
        <div>
            <center><font size="5px" color="red">欢迎[[${session?.user}]]登录后台服务</font></center>
            <a href="/logout">注销</a>
        </div>

    </div>



    <div data-options="region:'west',title:'功能',split:true" style="width:150px;">
        <ul id="tree"></ul>
    </div>
    <div data-options="region:'center',title:'展示'" style="padding:5px;background:#eee;">
        <div id="tabs" class="easyui-tabs" fit=true >  </div>
    </div>
</div>
</body>
</html>